package com.etcn.modules.busi.order.service;

import java.util.List;
import java.util.Map;

import com.etcn.common.service.ICrudService;
import com.etcn.modules.busi.order.dao.IWmOrderDao;
import com.etcn.modules.busi.order.pojo.WmOrder;


/**
 * 订单service
 *
 * @author guozc
 * @date 2018-03-19
 */
public interface IWmOrderService extends ICrudService<IWmOrderDao, WmOrder> {

    /**
     * 新增订单
     * @param entity
     * @return
     * @throws Exception
     */
    public Map<String,Object> add(WmOrder entity) throws Exception;

    /**
     * 获取会员订单
     * @return
     * @throws Exception
     */
    List<WmOrder> getMemberOrders(WmOrder order) throws Exception;

    /**
     * 根据订单号获取订单信息
     * @param orderSn
     * @return
     * @throws Exception
     */
    WmOrder getByOrderSn(String orderSn) throws Exception;
    
    /**
     * 支付宝统一下单
     * @param orderSn
     * @return 签名后的参数
     * @throws Exception
     */
    Map<String, Object> alipayPrePay(String orderSn) throws Exception;

    /**
     * 支付宝统一下单
     * @param wmOrder
     * @return 签名后的参数
     * @throws Exception
     */
    Map<String,Object> alipayPrePay(WmOrder wmOrder) throws Exception;
    
    /**
     * 微信统一下单
     * @param orderSn
     * @throws Exception
     */
    Map<String,Object> wxPrePay(String orderSn) throws Exception;
    
    /**
     * 微信统一下单
     * @param wmOrder
     * @throws Exception
     */
    Map<String,Object> wxPrePay(WmOrder wmOrder) throws Exception;
    
    /**
     * 支付
     * @param wmOrder
     * @throws Exception
     */
    void payOrder(WmOrder wmOrder) throws Exception;
    
    /**
     * 根据订单号更新
     */
    void updateByOrderSn(WmOrder wmOrder) throws Exception;


}